package edu.stthomas.seis752.model;

// default package
// Generated Apr 11, 2013 1:36:19 AM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CollectionType generated by hbm2java
 */
@Entity
@Table(name = "collection_type", catalog = "jibster")
public class CollectionType implements java.io.Serializable {

	private String code;
	private String description;
	private Date createDate;
	private Set<Collection> collections = new HashSet<Collection>(0);

	public CollectionType() {
	}

	public CollectionType(String code, String description, Date createDate) {
		this.code = code;
		this.description = description;
		this.createDate = createDate;
	}

	public CollectionType(String code, String description, Date createDate,
			Set<Collection> collections) {
		this.code = code;
		this.description = description;
		this.createDate = createDate;
		this.collections = collections;
	}

	@Id
	@Column(name = "code", unique = true, nullable = false, length = 3)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "description", nullable = false, length = 45)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", nullable = false, length = 0)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "collectionType")
	public Set<Collection> getCollections() {
		return this.collections;
	}

	public void setCollections(Set<Collection> collections) {
		this.collections = collections;
	}

}
